import Vue from 'vue';
import axios from 'axios';
import store from './store';
import commonV from '../../common/common'
let urltitle = commonV.httpUrl + 'fileMangement/'


export default {
  /**
    登录部分
  **/
  //测试接口
  test({
    commit,
    state
  }, params) {
    return axios({
      //url: urltitle + '/Mesapp/test',
      url: "http://192.168.4.166:8080/prj-gzjd/appProjectController!getEquip.m",
      method: 'post',
      data: params,
    });
  },

  //查
  getmsgData({
    commit,
    state
  }, allparams) {
    return axios({
      url: urltitle + allparams.api + "/",
      method: "get",
      params: allparams.params
    });
  },

  //增 post增 put改 delete删
  editmsgData({
    commit,
    state
  }, allparams) {
    let idKK = allparams.method == "post" ? '' : (allparams.params.id + "/")
    return axios({
      url: urltitle + allparams.api + "/" + idKK,
      method: allparams.method,
      data: allparams.params
    });
  },

  //导出
  exportData({
    commit,
    state
  }, allparams) {
    return axios({
      url: urltitle + allparams.api + "/",
      method: "post",
      data: allparams.params,
      responseType: "blob"
    });
  },

}
